import React from "react";
import { Text, TextInput, TouchableOpacity, View } from "react-native";

/**
 * 登录
 */
const LoginView = ({ navigation }) => {

    React.useLayoutEffect(() => {
        navigation.setOptions({
            headerShown: false,
            headerStyle: {
                // groundColor: '#01246E',
                //marginTop: 10,
            },
            headerRight: () => {

            }
        });
    }, [navigation]);

    return (
        <View>
            <Text style={{
                marginTop: 100,
                alignSelf: 'center',
                color: "#FF8E32",
                fontSize: 35,
            }}>{"欢迎回来"}</Text>

            <TextInput
                style={{
                    marginTop: 63,
                    marginHorizontal: 25,
                    height: 56,
                    // backgroundColor: '#A7A9B2',
                    borderRadius: 5,
                    borderWidth: 1,
                    borderColor: '#A7A9B2',
                    paddingLeft: 20,
                    fontSize: 14,
                }}
                placeholder={"请输入用户名"}
            ></TextInput>

            <TextInput
                style={{
                    marginTop: 20,
                    marginHorizontal: 25,
                    height: 56,
                    // backgroundColor: '#A7A9B2',
                    borderRadius: 5,
                    borderWidth: 1,
                    borderColor: '#A7A9B2',
                    paddingLeft: 20,
                    fontSize: 14,
                }}
                placeholder={"请输入密码"}
            ></TextInput>

            <TouchableOpacity
                style={{
                    marginTop: 20,
                    marginRight: 25,
                    alignSelf: 'flex-end',
                }}
                onPress={(e) => {
                    navigation.navigate("ResetPasswordView")
                }}
            >
                <Text style={{
                    color: '#FF8E32',
                    fontSize: 11,
                    lineHeight: 22,
                }}
                >{"忘记密码了？"}</Text>
            </TouchableOpacity>

            <TouchableOpacity
                style={{
                    marginTop: 58,
                    marginHorizontal: 25,
                    backgroundColor: '#FF8E32',
                    borderRadius: 5,
                }}
                onPress={(e)=>{
                    navigation.navigate("BottomTabs")
                }}
            >
                <Text
                    style={{
                        alignSelf: 'center',
                        marginVertical: 16,
                        color: '#FFFFFF',
                        fontSize: 16,
                        lineHeight: 24,
                    }}
                >{"登录"}</Text>
            </TouchableOpacity>

            <View
                style={{
                    marginTop: 33,
                    alignItems: 'center',
                }}
            >
                <Text
                    style={{
                        alignItems: 'center',
                        color: '#000000',
                        fontSize: 16,
                        lineHeight: 18.75,
                    }}
                >
                    {"还没有账号?"}
                    <TouchableOpacity
                        style={{
                            alignItems: 'center',
                        }}
                        onPress={(e) => {
                            navigation.navigate("RegisterView")
                        }}
                    >
                        <Text
                            style={{
                                alignSelf: 'center',
                                color: '#FF8E32',
                                fontSize: 16,
                                lineHeight: 18.75,
                            }}
                        >{"立即注册"}</Text>
                    </TouchableOpacity>
                </Text>
            </View>
        </View>
    )
}

export default LoginView;
